/**
 * 生产环境配置
 *
 * 最终生效的配置为 prod + default（前者覆盖后者）
 */
const path = require('path');

module.exports = app => {
  const exports = {};

  exports.logger = {
    consoleLevel: 'WARN',
    dir: path.join(app.baseDir, 'logs'),
  };

  //阿里云 RDS
  exports.sequelize = {
    logging: false,
    host: '',
    port: '3306',

    database: 'spider',
    username: 'spider',
    password: '',
    timezone: '+08:00',

    pool: {
      max: 20,
      min: 0,
    },
  };

  exports.redis = {
    client: {
      port: 63790,          // Redis port
      host: '',   // Redis host
      password: '',
      db: 1,
    },
    agent: true,
  };

  exports.spiderClient = {
    codeUrl: '',
    socketUrl: '',
  };

  exports.alinode = {
    server: '',
    appid: '',
    secret: '',
    logdir: '/home/live_spider/logs/',
    // error_log: [
    //   '您的应用在业务层面产生的异常日志的路径，数组，可选，可配置多个',
    //   '例如：/root/.logs/error.#YYYY#-#MM#-#DD#.log',
    //   '不更改 Egg 默认日志输出路径可不配置本项目',
    // ],
    agentidMode: '',
  };

  return exports;
};
